from django.test import TestCase

# Create your tests here.
from django.test import TestCase

# Create your tests here.
import socket
import json
import phone
import requests
if __name__ == '__main__':
    ip_address = socket.gethostbyname('www.by1997.com')
    # ip_address = socket.gethostbyname('ip.e-dunhuang.com')


    # url = "http://ip.taobao.com/outGetIpInfo?ip={}&accessKey=alibaba-inc".format(ip_address)
    # req = requests.get(url).text
    # json1 = json.loads(req)
    # print(json1)
    print(ip_address)
    url = f'http://ip-api.com/json/{ip_address}'
    response = requests.get(url)
    print(response.json())
    print(response.json().get('timezone'))